<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>name</title>

    <!-- 引入样式 -->

    <link rel="stylesheet" href="../plugins/elementui/index.css">

    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">

    <link rel="stylesheet" href="../css/style.css">

</head>
<body>

<div id="app">

    <div align="center">

        <div style="margin: 20px;"><h1>登录</h1></div>
        <el-form :label-position="labelPosition" label-width="400px" :model="formLabelAlign">
            <el-form-item label="账号">
                <el-input v-model="formLabelAlign.username"></el-input>
            </el-form-item>
            <el-form-item label="密码">
                <el-input v-model="formLabelAlign.password"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer" align="center">
            <el-button type="primary" @click="Login()">提交</el-button>
        </div>

    </div>

</div>

<!--引入组件库-->
<script src="../js/vue.js"></script>

<script src="../plugins/elementui/index.js"></script>

<script type="text/javascript" src="../js/jquery.min.js"></script>

<script src="../js/axios-0.18.0.js"></script>

<script>
    new Vue({
        el: "#app",
        data:{
            labelPosition: 'right',
            formLabelAlign: {
                username:'',
                password:''
            }
        },
        methods:{
            Login(){
                axios.get("/network/visit/"+this.formLabelAlign.username+"/"+this.formLabelAlign.password).then((res)=>{
                    if (res.data.code === 20041){
                        alert("登录成功！！！");
                        location.href="http://localhost/pages/visit_main.html";
                    }else {
                        alert("登录失败！！！");
                    }
                });
            }
        }
    })
</script>
</body>
</html>